package com.schillerchina.baselibrary.network.interceptor;import android.util.Log;import io.reactivex.Observable;import io.reactivex.functions.Function;/** * @author zhangzhiguo * @date 2019-08-05 09:39 * @Description: 服务器错误统一处理 */public class ServerErrorInterceptor<T> implements Function<T, Observable<T>> {    @Override    public Observable<T> apply(T t) throws Exception {        Log.i("net","apply:"+t.toString());        if (t == null) {            return Observable.error(new Throwable("Parse response failed"));        }//        if (t instanceof JsonResult) {//            if (exception != null) {//                return Observable.error(exception);//            }            return Observable.just(t);//        } else {//            return Observable.error(new RetrofitException("数据类型错误"));//        }    }}